function [hfile, densm] = srf_Inflate(hfile, niter, force)
% SRF::Inflate  - apply inflation morph
%
% FORMAT:       [srf, densm] = srf.Inflate([niter [, force]])
%
% Input fields:
%
%       niter       number of iterations, default 2000
%       force       smoothing force, default 0.75
%
% Output fields:
%
%       srf         inflated surface
%       densm       density SMP
%
% Note: this method simply passes to SRF::Morph. It automatically set
%       area and distortion correction (to 6 * smoothing)

% Version:  v0.7b
% Build:    7092917
% Date:     Sep-29 2007, 5:25 PM CEST
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin < 1 || ...
    numel(hfile) ~= 1 || ...
   ~isBVQXfile(hfile, 'srf')
    error( ...
        'BVQXfile:BadArgument', ...
        'Invalid call to ''%s''.', ...
        mfilename ...
    );
end
if nargin < 2 || ...
   ~isa(niter, 'double') || ...
    numel(niter) ~= 1 || ...
    isnan(niter) || ...
    niter < 0 || ...
    niter > 1e5
    niter = 3000;
else
    niter = floor(niter);
end
if nargin < 3 || ...
   ~isa(force, 'double') || ...
    numel(force) ~= 1 || ...
    isnan(force) || ...
    force <= 0 || ...
    force >= 1
    force = 0.7;
end
opts = struct;
opts.areac = 1;
opts.distc = min(3 - eps, 6 * force);
opts.title = 'Inflating';

% depending on nargout
if nargout > 1
    [hfile, densm] = srf_Morph(hfile, niter, force, 'smooth', opts);
else
    srf_Morph(hfile, niter, force, 'smooth', opts);
end
